﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Pages_GetImage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string ID = "0";
            string type = "";
            int imgNo = 0;
            if (Request.QueryString.Count > 2)
            {
                ID = Request.QueryString["id"];
                type = Request.QueryString["Type"];
                imgNo = Convert.ToInt32(Request.QueryString["ImageNo"]);
            }
            DataTable dt = new DataTable();
            dt = DataAccessClass.GetLogo(Convert.ToInt32(ID), type, imgNo);

            foreach (DataRow dRow in dt.Rows)
            {
                //Response.ContentType = dRow["img_type"].ToString();
                byte[] imageContent = (byte[])((dRow["ImageName"]));
                Response.BinaryWrite(imageContent);
            }


        }
        catch (Exception SQLexc)
        {
            Response.Write("Data Retrival Failure. Error Details : " + SQLexc.ToString());
        }
    }
}
